const Promise = require('bluebird');
function foo (a , b, callback) {
  const result = a + b;
  // return result;
  return callback(null, result);
}

function func (c, d, callback) {
  const array = [c];
  const number = c - d;
  console.log('number:' + number);
  array.push(number);
  return callback(null, array);
}

function f (e, f) {
  const count = e * f;
  console.log('count:' + count);
}

async function main(num1, num2) {
  const fooAsync = Promise.promisify(foo);
  const funcAsync = Promise.promisify(func);
  const fAsync = Promise.promisify(f);
  const data = await fooAsync(num1, num2);
  console.log('data:' + data);
  const arr = await funcAsync(num1, num2);
  console.log('arr:' + arr[1]);
  await fAsync(num1, num2);
}

main(7,3);

